<template>
	<van-cell-group>
		<van-search show-action v-model="searchValue" shape="round" background="#00afff" placeholder="请输入搜索关键词" @search="onSearch">
			<template #action>
				<div><van-icon name="cross" @click="complete"/></div>
			</template>
		</van-search>
		<van-checkbox-group v-model="selectedValues" shape="square">
			<van-cell v-for="(item,index) in zds" :key="index">
				<van-checkbox :name="item">
					{{ item.zdName }}
				</van-checkbox>
			</van-cell>
		</van-checkbox-group>

	</van-cell-group>

</template>

<script setup lang="ts">
	import { iface_zd } from '@/types/global'
	import { showToast } from 'vant'
	import { ref, reactive } from 'vue'
	const selectedValues = ref([]);
	const zds : iface_zd[] = reactive([
		{ province: '四川省', city: '成都市', area: '青羊区', zdName: '测试医院1', level: 1, grade: 2 },
		{ province: '四川省', city: '成都市', area: '青羊区', zdName: '测试医院2', level: 1, grade: 2 }
	])
	
	const emit = defineEmits<{ closewindow: any }>();
	
	const searchValue = ref('')
	const onSearch = () => {
		showToast('搜索成功');
	}
	const complete = ()=>{
		emit('closewindow',selectedValues);
	}
</script>

<style>
</style>